<script>on mouseupput empty into meend mouseup</script>
</part>
<part>
<id>1</id>
<type>button</type>
<visible> <true /> </visible>
<reserved5> 0 </reserved5>
<reserved4> 0 </reserved4>
<reserved3> 0 </reserved3>
<reserved2> 0 </reserved2>
<reserved1> 0 </reserved1>
<enabled> <true /> </enabled>
<rect>
<left>0</left>
<top>0</top>
<right>32</right>
<bottom>13</bottom>
</rect>
<style>opaque</style>
<showName> <true /> </showName>
<highlight> <true /> </highlight>
<autoHighlight> <false /> </autoHighlight>
<sharedHighlight> <true /> </sharedHighlight>
<family>0</family>
<titleWidth>0</titleWidth>
<icon>0</icon>
<textAlign>center</textAlign>
<font>Chicago</font>
<textSize>12</textSize>
<textStyle>plain</textStyle>
<name>File</name>
<script>on mouseUpset the hilite of me to trueend mouseUpon mousedownglobal theMenu,oldvolset the hilite of me to falseget PopUpMenu (theMenu,0,left of me,bottom of me)if it>0 then-- set the hilite of me to trueif it = 1 thenif volume()<7 then get volume(volume()+1)put volume() into oldvolif volume() >6 thenput "(Sound up +" into item 1 of themenuend ifput "Sound down -" into item 2 of themenuelse if it = 2 thenif volume() >0 then get volume(volume()-1)put volume() into oldvolif volume() <1 thenput "(Sound down -" into item 2 of themenuend ifput "Sound up +" into item 1 of themenuelse if it = 3 thenglobal bdif bd 竕 "" thenput Backdrop (bd,"dispose") into rsltput empty into bd--doMenu "hide others"elseput Backdrop ("new","serialNumber=20148329-594","show") into bd-- doMenu "show all"end ifelse if it = 4 thenSndPlay "PauseDriver","true" --...PAUSEshowDialog 1,182,,falseif the result is 2 thenSndPlay "PauseDriver","false"set the hilite of me to trueexit mousedownend ifelse if it =5 then --...NEW GAMEshowDialog 1,181,,falseif the result is 2 thensndPlay "stop","0"MonitorFade down,5set the hilite of me to truelock screengo cd "logbook"NEWGAMEsend OPENCARD to cd "logbook"unlock screenMonitorfade up,1EXIT to hyperCardend ifelse if it =6 then --...QUIT & SAVEset the hilite of me to truesndplay "stop","0"set cursor to "watch"domenu "quit HyperCard"end ifend if-- if the result is not empty then answer the resultset the hilite of me to truehide menubarend mousedownon mouseleaveset the hilite of me to trueend mouseleave</script>
<script>on calcspeedglobal vvar,heading,v,s1,s2,throttle,speedx,maxS,badd vvar to vadd -vvar*12.5 to speedx --equates to 0 or 25 or -25 ...width of speedo pictif (throttle is "full" and v =maxS) or (throttle is "back" and v=(maxS-40)) or (throttle is "neutral" and v =(maxS-20)) then put 0 into vvar --if throt 竕 neut then will continue up or downput heading/57.28 into u2put v*sin(u2) into s1put -v*cos(u2) into s2end calcspeedon calcspeedGroupglobal gheading,vv,ss1,ss2put gheading/57.28 into u2put vv*sin(u2) into ss1put -vv*cos(u2) into ss2end calcspeedGroupon calcHeadingglobal s1,s2,headingput CALCINVERSETANGENT (s1,s2) into headingend calcheadingon calcGroupHeadingglobal gheading,wwbearing,bb,xx1,way1,xx2,way2get round(abs(gheading - wwbearing))if it 竕 0 thenif it <5 thenif bb <0 then put -1 into bbelse if bb >0 then put 1 into bbend ifelse put 0 into bbput normalize360(gheading +bb) into gheading---------put -(xx1-way1) into m1put -(xx2-way2) into m2put CALCINVERSETANGENT (m1,m2) into wwBearingend calcGroupHeadingon calcRangeBearingBase --3520global x1,x2,bRange,bBearing-------calc Range to base... if base at 0,0----------get sqrt(x1*x1+x2*x2)put (trunc(it/16.1)/100) into bRange---------calc Course to base-------put CALCINVERSETANGENT (-x1,-x2) into bbearingend calcRangeBearingBaseon calcRangeBearingWayPointglobal x1,x2,way1,way2,wRange,wbearing-----calcRange-----put -(x1-way1) into m1put -(x2-way2) into m2get sqrt(m1*m1+m2*m2)put (trunc(it/16.1)/100) into wRange----calc bearing-------put CALCINVERSETANGENT (m1,m2) into wbearingend calcRangeBearingWayPointon calcRangeBearingTargetglobal x1,x2,xxx1,xxx2,tRange,tbearing-----calcRange-----put -(x1-xxx1) into m1put -(x2-xxx2) into m2get sqrt(m1*m1+m2*m2)put (trunc(it/16.1)/100) into tRange----calc bearing-------put CALCINVERSETANGENT (m1,m2) into tbearingend calcRangeBearingTargeton calcRangeBearingGroup --3520global x1,x2,xx1,xx2,range,gRange,gbearing-----calcRange-----put -(x1-xx1) into m1put -(x2-xx2) into m2put sqrt(m1*m1+m2*m2) into rangeput (trunc(range/16.1)/100) into gRange --窶「CONVERT METERS TO MILES...x1609----calc bearing-------put CALCINVERSETANGENT (m1,m2) into gbearingend calcRangeBearingGroupon calcNewPositions --also checkGround & chance (fighters)global t3,x1,x2,xx1,xx2,s1,s2,ss1,ss2,fighters--窶「put t3/4 into iput t3/2 into i --窶「窶「窶「TESTput x1+s1*i into x1put xx1+ss1*i into xx1put x2+s2*i into x2put xx2+ss2*i into xx2CHECKGROUND x1,x2if (x1 * .0001) >random(2000) then put true into fightersend calcNewPositionson checkground x1,x2global flak,newGround,counter,place,tRange,grange,alt,missionAlt,way1get WHEREAREWE (x1,x2)if it = NewGround then EXIT CHECKGROUND --ground features have not changed...else:----------------------------if it =9 thenCALCRANGEBEARINGTARGETif tRange <6 or alt <20000 thensndplay "play","3","flakahead","48"put true into FLAKput 0 into counter --resets flak routine in cockpitend ifelse if it =1 thenif way1 = 0 and missionAlt >2000 then --crossed english coast on way homeput 2000 into missionAltif gRange <3 thensndPlay "play","2","comToGroup",48sndPlay "play","2","descendTo2000",48sndPlay "play","2","commandOut",48end ifend ifend if----------------put it into NewGroundif it 竕 9 then put it into place --if flak,last newGround preservedend checkGroundon CheckFuelAndLiftglobal lift,fuel,fuelLeak,plane,v,t3,gw----------if v <88 and plane is "climbing" then put "level" into planeif lift 竕、0 or v<68 then put "diving" into plane---------if fuel >0 thenput t3/2 into iif fuelLeak then subtract .1*i from fuelsubtract (((v*.001)+gw)*i) from fuelif fuel <0 thenput 0 into fuelput 0 into liftsndPlay "stop","1"-- sndPlay "play","1","taxi","32"sndPlay "play","2","uhoh","48"sndPlay "play","1","fuelout","32","continuous"end ifend ifend checkFuelAndLifton reRouteGroupglobal theLine,xx1,xx2,ss1,ss2,way1,way2,gheading,wwBearing,bb,missionAlt,gRange,trange,vv,onCourse,flag-- if bb 竕 0 then EXIT REROUTEGROUP --don't do this more than onceput false into onCourse --turn off green light in cockpit--put false into flag --set to true on commence of bombrunget item 1 of theLine --窶「counterput item it of theLine into way1 --窶「next waypoint xif way1 is empty then --窶「Bomber group has landed back at baseput 0 into vvEXIT REROUTEGROUPend ifput item it+1 of theLine into way2 --窶「next waypoint yput it+2 into item 1 of theLine --窶「reset counter---------get bearing to next waypoint-------put -(xx1-way1) into m1put -(xx2-way2) into m2put CALCINVERSETANGENT (m1,m2) into wwBearing----------add + or - 1 degree to gheading-------if NORMALIZE180(gHeading-wwBearing)<0 then put 2 into bbelse put -2 into bb --was 4CALCRANGEBEARINGGROUPCALCRANGEBEARINGTARGETif gRange <3 and tRange >1 thenif way1 =0 then NEWMISSIONALT --last turn...descendSAYWAYPOINT--窶「 if way1 =0 then NEWMISSIONALT --last turn...descendend ifend reRouteGroupon newMissionAlt --see "on checkGround" for moreglobal missionAltif missionAlt = 5000 thenput 3000 into missionAltput 2 into devilsAltelse if missionAlt = 7000 thenput 3000 into missionAltput 4 into devilsAltelse if missionAlt = 9000 thenput 3000 into missionAltput 6 into devilsAltelse if missionAlt = 12000 thenput 4000 into missionAltput 8 into devilsAltelse if missionAlt = 16000 thenput 7000 into missionAltput 9 into devilsAltelse if missionAlt = 21000 thenput 12000 into missionAltput 9 into devilsAltelse if missionAlt = 24000 thenput 13000 into missionAltput 9 into devilsAltend ifsndPlay "play","2","comToGroup",48sndPlay "play","2","goToDevils",48sndPlay "play","2",c&devilsAlt,48end newMissionAlton saywaypointglobal wRange,wbearing,heading,bearing,way1,missionaltCALCRANGEBEARINGWAYPOINTput round(wRange) into rangeput round(wBearing) into bearingif way1 竕 0 then sndPlay "play","2","comToGroup",48sndPlay "play","2","goingTocourse",48repeat with i = 1 to 3sndPlay "play","2",c&(char i of bearing),48end repeatsndPlay "play","2","commandOut",48end saywaypointon saygearglobal gearif gear is "down" thensndPlay "play","2","gearup",32sndPlay "play","2","skip",32end ifend saygearon sayoxygen --accessed by updateClimb onlyglobal oxygenif oxygen is "off" thensndPlay "play","2","oxy",32sndPlay "play","2","skip",32put empty into oxygenelse if oxygen is "disabled" then put empty into oxygenend sayoxygenon sayheater --accessed by updateClimb onlyglobal heaterif heater is "off" thensndPlay "play","2","heater",32sndPlay "play","2","skip",32put empty into heaterelse if heater is "disabled" then put empty into heaterend sayheater------------------------------------------------------------function CalcInverseTangent m1,m2global p2if m1 = 0 thenif m2竕、0 thenput 0 into resultelseput p2 into resultend ifelseput atan(m2/m1)+p2*1.5 into resultif m1 >0 then add -p2 to resultend ifreturn result * 57.2958end CalcInverseTangentfunction normalize180 argif arg <-180 then add 360 to argelse if arg>=180 then add -360 to argif arg <-180 then add 360 to argelse if arg>=180 then add -360 to argreturn argend normalize180function normalize360 argif arg <0 then add 360 to argelse if arg>=360 then add -360 to argif arg <0 then add 360 to argelse if arg>=360 then add -360 to argreturn argend normalize360------returns 1 england,2 friendly water,3 hostile water,4 ger,5 holland,------6 belg,7 france,8 lux,9 flak,10 swedenfunction whereAreWe x1,x2get trunc(((x2+241350)/1609)*.1)+1put line it of fld id 8 into latlineget trunc(((x1+80450)/1609)*.1)+1return item it of latlineend whereAreWeon hit damage,whereglobal lift,alreadyhit,gear,heater,oxygen,gw,alt,props,fuel,vvar,maxS,pitchif damage is empty then --these are flak hits. flak does not predetermine damageput "Oxygen out,Heaters out,Landing gear crippled,engines,Fuelleak,cabin,wings,aileron,Rudder" into hitsput any item of hits into damage --窶「窶「TEMP OUTend ifif alreadyHit contains damage or lift <1 then --put damage after alreadyhit --now at endsndplay "play","2","close","32"EXIT HITend if----------------------if damage contains "gear" and random(4)<4 thensndplay "play","2","close","32"EXIT HITelse if damage contains "wings" then --窶「"wings" will always pass alreadyhit as alreadyHit will never contain itsndplay "play","2","wing","32"sndplay "play","2","hit","32"sndplay "play","2","skip","32"if where >400 then put "Starboard wing" into damageelse put "Port wing" into damageadd -5 to liftelse if damage contains "aileron" then --窶「"aileron" will not pass alreadyhit twice as alreadyHit will contain itsndplay "play","2","ail","32"sndplay "play","2","skip","32"if where >400 then put "Starboard aileron" into damageelse put "Port aileron" into damageadd -5 to liftelse if damage contains "rudder" thensndplay "play","2","rud","32"sndplay "play","2","skip","32"add -5 to liftelse if damage contains "gear" thensndplay "play","2","uhoh","32"put empty into gearadd -3 to liftelse if damage contains "heaters" thenif alt >10000 then put empty into heater --alerts idleloop to flash htr btnelseput "disabled" into heaterend ifset the icon of btn "heater" of cd "cockpit" to "heaterOff"sndplay "play","2","heater","32"sndplay "play","2","out","32"add -3 to liftelse if damage contains "oxygen" thenif alt >15000 then put empty into oxygen --alerts idleloop to flash oxy btnelseput "disabled" into oxygenend ifset the icon of btn "oxygen" of cd "cockpit" to "oxygenOff"sndplay "play","2","oxy","32"sndplay "play","2","out","32"add -3 to liftelse if damage contains "fuel" thenglobal fuelLeakput true into fuelLeak --- put gw*1.5 into gwsndplay "play","2","uhoh","32"--窶「sndplay "play","2","weveGot a fuel leak","32"add -5 to lift---------------------ENGINES-------------else if damage contains "engines" then --窶「"engines" will always pass alreadyhit as alreadyHit will never contain itif where >400 then get 2+random(2) --engine 3 or 4else if maxS >68 then get 2 --engine 2elseget 1 --save no.1 engine for lastput 0 into fuel --konk out enginesend ifput "No."&it&" engine" into damageif alreadyHit contains damage thensndplay "play","2","close","32"EXIT hit --窶「dont hit the same engine twiceend ifsndplay "play","2","engHit","42"sndplay "play","2","skip","42"if item it of props is empty then --if not,player has "feathered" prop for no reason,so hit would have no immediate effectsubtract 20 from MaxS --drop max speed by 20put -2 into vvar --start decreasing speedadd 1 to pitch --raise engine sound to next higher pitchif random(3)<3 thenput "windmilling" into item it of propsif Lift >0 thenadd -30 to lift -- put back 5 on featheringsndPlay "stop","1"sndPlay "play","1","Eng"&pitch,48,"continuous"put damage&" windmilliling" into fld "messages"end ifelseRUNAWAY itput damage&". RUNAWAY" into fld "messages"end ifend if-----------------CREW HIT--------------------else if damage contains "wounded" then --sndplay "play","2","imHit","32"sndplay "play","2","skip","32"end if-----------------------------------put return&damage after alreadyhitif "engine" is not in damage then put damage into fld "messages" --handled in enginesend hiton runaway itglobal props,lift,templift,alt,landAltput "runaway" into item it of propssndPlay "stop","1"sndplay "play","1","Deathspiral","32","continuous"sndplay "play","2","uhoh","32" --窶「"we got a runaway"put lift into tempLiftput 0 into lift -- put templift -25 back after featheringput alt -2000 into landAltend runaway</script>